<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Common_data {
	
	function _get_operate_chs_by_eng($eng) {
		$operate_array['create'] = '新建';
		$operate_array['edit'] = '修改';
		$operate_array['delete'] = '删除';
		if ($eng == '') {
			return $operate_array;
		} else {
			return $operate_array[$eng];
		}
	}
	
	/**
     * 通过社团所属分类得到分类名称
     * @param $cid
     */
  	function _get_society_category_name_by_cid($cid = '') {
  		$category_array[0] = '全部';
		$category_array[1] = SOCIETY_CATEGORY_01_CHS;
		$category_array[2] = SOCIETY_CATEGORY_02_CHS;
		$category_array[3] = SOCIETY_CATEGORY_03_CHS;
		$category_array[4] = SOCIETY_CATEGORY_04_CHS;
		$category_array[5] = SOCIETY_CATEGORY_05_CHS;
		$category_array[6] = SOCIETY_CATEGORY_06_CHS;
		$category_array[7] = SOCIETY_CATEGORY_07_CHS;
		if ($cid == '') {
			return $category_array;
		} else {
			return $category_array[$cid];
		}
  	}
  	
	/**
     * 通过社联员工所属部门分类得到分类名称
     * @param $cid
     */
	function _get_association_category_name_by_cid($cid = '') {
    	$department_array[ASSOCIATION_XCB_CID] = ASSOCIATION_XCB_NAME;
    	$department_array[ASSOCIATION_WLJSB_CID] = ASSOCIATION_WLJSB_NAME;
    	$department_array[ASSOCIATION_CHB_CID] = ASSOCIATION_CHB_NAME;
    	$department_array[ASSOCIATION_STGLB_CID] = ASSOCIATION_STGLB_NAME;
    	$department_array[ASSOCIATION_ZZB_CID] = ASSOCIATION_ZZB_NAME;
    	$department_array[ASSOCIATION_BGS_CID] = ASSOCIATION_BGS_NAME;
    	if ($cid == '') {
			return $department_array;
		} else {
			return $department_array[$cid];
		}
    }
    
	/**
     * 通过管理员所属分类得到分类名称
     * @param $cid
     */
	function _get_admin_category_name_by_cid($cid = '') {
    	$admin_array[ASSOCIATION_XCB_CID] = ASSOCIATION_XCB_NAME;
    	$admin_array[ASSOCIATION_WLJSB_CID] = ASSOCIATION_WLJSB_NAME;
    	$admin_array[ASSOCIATION_CHB_CID] = ASSOCIATION_CHB_NAME;
    	$admin_array[ASSOCIATION_STGLB_CID] = ASSOCIATION_STGLB_NAME;
    	$admin_array[ASSOCIATION_ZZB_CID] = ASSOCIATION_ZZB_NAME;
    	$admin_array[ASSOCIATION_BGS_CID] = ASSOCIATION_BGS_NAME;
    	$admin_array[ADMIN_TEACHER_CID] = ADMIN_TEACHER_NAME;
    	$admin_array[ADMIN_SUPER_CID] = ADMIN_SUPER_NAME;
    	if ($cid == '') {
			return $admin_array;
		} else {
			return $admin_array[$cid];
		}
    }
    
    /**
     * 通过站点所属分类得到分类名称
     * @param $cid
     */
	function _get_user_category_name_by_cid($cid = '') {
		$user_category[0] = '类型';
    	$user_category[SOCIETY_UCID] = SOCIETY_CHS;
    	$user_category[ASSOCIATION_UCID] = ASSOCIATION_CHS;
    	$user_category[TEACHER_UCID] = TEACHER_CHS;
    	$user_category[ADMIN_UCID] = ADMIN_CHS;
    	if ($cid == '') {
			return $user_category;
		} else {
			return $user_category[$cid];
		}
    }
    
	function _get_user_category_eng_by_ucid($ucid = '') {
		$user_category[0] = '类型';
    	$user_category[SOCIETY_UCID] = SOCIETY;
    	$user_category[ASSOCIATION_UCID] = ASSOCIATION;
    	$user_category[TEACHER_UCID] = TEACHER;
    	$user_category[ADMIN_UCID] = ADMIN;
    	if ($ucid == '') {
			return $user_category;
		} else {
			return $user_category[$ucid];
		}
    }
    
    /**
     * 社团状态
     * 一共3种
     */
    //对象：浏览本站者
	function _get_society_status_by_confirm_flag_public($confirm_flag = '') {
    	$status_array[SOCIETY_TO_VERIFY] = '已注册（待审核）';
    	$status_array[SOCIETY_TRIAL_PASS] = '正在审核';
    	$status_array[SOCIETY_TRIAL_FAIL] = '审核失败';
    	$status_array[SOCIETY_REVIEW_PASS] = '正在审核';
    	$status_array[SOCIETY_REVIEW_FAIL] = '审核失败';
    	$status_array[SOCIETY_FINAL_PASS] = '已通过审核';
    	$status_array[SOCIETY_FINAL_FAIL] = '审核失败';
    	if ($confirm_flag == '') {
			return $status_array;
		} else {
			return $status_array[$confirm_flag];
		}
    }
    
    //对象：社团
	function _get_society_status_by_confirm_flag($confirm_flag = '') {
    	//$since_array[0] = '不限';
    	
    	//尚未审核
    	$status_array[SOCIETY_TO_VERIFY] = SOCIETY_TO_VERIFY_CHS;
    	
    	//初审通过
    	$status_array[SOCIETY_TRIAL_PASS] = SOCIETY_TRIAL_PASS_CHS;
    	//初审失败
    	$status_array[SOCIETY_TRIAL_FAIL] = SOCIETY_TRIAL_FAIL_CHS;
    	
    	//复审通过
    	$status_array[SOCIETY_REVIEW_PASS] = SOCIETY_REVIEW_PASS_CHS;
    	//复审失败
    	$status_array[SOCIETY_REVIEW_FAIL] = SOCIETY_REVIEW_FAIL_CHS;
    	
    	//终审通过
    	$status_array[SOCIETY_FINAL_PASS] = SOCIETY_FINAL_PASS_CHS;
    	//终审失败
    	$status_array[SOCIETY_FINAL_FAIL] = SOCIETY_FINAL_FAIL_CHS;
    	
    	if ($confirm_flag == '') {
			return $status_array;
		} else {
			return $status_array[$confirm_flag];
		}
    }
    
	//对象：社联 - 社团管理部
	function _get_society_status_for_association($confirm_flag_id = '') {
    	$status_array[0] = '全部';
    	//尚未审核
    	$status_array[1] = SOCIETY_TO_VERIFY_CHS;
    	
    	//初审通过
    	$status_array[2] = SOCIETY_TRIAL_PASS_CHS;
    	//初审失败
    	$status_array[3] = SOCIETY_TRIAL_FAIL_CHS;
    	
    	if ($confirm_flag_id == '') {
			return $status_array;
		} else {
			return $status_array[$confirm_flag_id];
		}
    }
    
	/**
     * 社联成员状态
     * 
     */
    //对象：社联成员
	function _get_association_status_by_confirm_flag($confirm_flag = '') {
		
		//尚未审核
    	$status_array[ASSOCIATION_TO_VERIFY] = ASSOCIATION_TO_VERIFY_CHS;
    	
    	//审核失败
    	$status_array[ASSOCIATION_VERIFY_FAIL] = ASSOCIATION_VERIFY_FAIL_CHS;
    	
    	//审核通过
    	$status_array[ASSOCIATION_VERIFY_PASS] = ASSOCIATION_VERIFY_PASS_CHS;
    	
    	if ($confirm_flag == '') {
			return $status_array;
		} else {
			return $status_array[$confirm_flag];
		}
    }
    
	//对象：社联成员
	function _get_association_function_by_function_flag($function_flag = '') {
    	$function_array[NOT_FUNCTION] = NOT_FUNCTION_CHS;
    	$function_array[IS_FUNCTION] = IS_FUNCTION_CHS;
    	
    	if ($function_flag == '') {
			return $function_array;
		} else {
			return $function_array[$function_flag];
		}
    }
    
	function _get_society_photo_category_name_by_cid($cid = '') {
    	$photo_array[SOCIETY_LOGO] = SOCIETY_LOGO_CHS;
    	$photo_array[SOCIETY_BANNER] = SOCIETY_BANNER_CHS;
    	$photo_array[SOCIETY_SHOW] = SOCIETY_SHOW_CHS;
    	if ($cid == '') {
			return $photo_array;
		} else {
			return $photo_array[$cid];
		}
    }
    
	function _get_society_photo_ratio_by_cid($cid = '') {
    	$photo_ratio_array[SOCIETY_LOGO] = SOCIETY_LOGO_RATIO;
    	$photo_ratio_array[SOCIETY_BANNER] = SOCIETY_BANNER_RATIO;
    	$photo_ratio_array[SOCIETY_SHOW] = SOCIETY_SHOW_RATIO;
    	if ($cid == '') {
			return $photo_ratio_array;
		} else {
			return $photo_ratio_array[$cid];
		}
    }
    
	/**
     * 通过星期的英文得到相应中文，供最顶部导航使用
     * @param $english
     */
	function _get_days_by_english($english = '') {
    	$days_array['Sunday'] = '星期天';
    	$days_array['Monday'] = '星期一';
    	$days_array['Tuesday'] = '星期二';
    	$days_array['Wednesday'] = '星期三';
    	$days_array['Thursday'] = '星期四';
    	$days_array['Friday'] = '星期五';
    	$days_array['Saturday'] = '星期六';
    	if ($english == '') {
			return $days_array;
		} else {
			return $days_array[$english];
		}
    }
    
	function _get_gender_by_cid($gender = '') {
    	$gender_array[1] = '男';
    	$gender_array[2] = '女';
    	
    	if ($gender == '') {
			return $gender_array;
		} else {
			return $gender_array[$gender];
		}
    }
    
	function _get_news_announcement_status_by_cid($cid = '') {
		$status_array[1] = NOT_PUBLISHED_CHS;
    	$status_array[2] = IS_PUBLISHED_CHS;
    	if ($cid == '') {
			return $status_array;
		} else {
			return $status_array[$cid];
		}
    }
    
}